package com.dfba.Homework4;

public abstract class Animal {
    private String name;
    private double weight;
    abstract void eat();// 在抽象类Animal中包含name,weight属性和一个抽象的eat方法

    public Animal(String name, double weight) {
        this.name = name;
        this.weight = weight;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
}
